package com.ship.boats.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ship.boats.domain.SpBoatsArchivesExtend;
import com.ship.boats.mapper.BoatsArchivesExtendMapper;
import com.ship.boats.service.BoatsArchivesExtendService;
import com.ship.boats.service.BoatsArchivesService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <b>BoatsArchivesExtendServiceImpl</b>
 *
 * @description: BoatsArchivesExtendServiceImpl <br>
 * @date: 2024/4/19 10:36 <br>
 * @author: lhm <br>
 * @version: 1.0 <br>
 */

@Service
public class BoatsArchivesExtendServiceImpl extends ServiceImpl<BoatsArchivesExtendMapper, SpBoatsArchivesExtend> implements BoatsArchivesExtendService {
    private static final Logger logger = LoggerFactory.getLogger(BoatsArchivesExtendServiceImpl.class);

    @Override
    public void addBoatsArchives(SpBoatsArchivesExtend spBoatsArchivesExtend) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("imo",spBoatsArchivesExtend.getImo());
        SpBoatsArchivesExtend spBoatsArchivesExtend1 = baseMapper.selectOne(queryWrapper);
        if (null == spBoatsArchivesExtend1) {
            baseMapper.insert(spBoatsArchivesExtend);
        }
    }

    @Override
    public void saveArchiveExtendAll(List<SpBoatsArchivesExtend> archivesExtendList) {
        this.saveBatch(archivesExtendList);
    }
}
